package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Great;
import cn.wolfcode.trip.base.domain.SystemCall;
import cn.wolfcode.trip.base.mapper.GreatMapper;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.service.IGreatService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class GreatServiceImpl implements IGreatService {

    @Autowired
    private GreatMapper greatMapper;


    @Override
    public void deleteByPrimaryKey(Long id) {
        greatMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void insert(Great record) {
        greatMapper.insert(record);
    }

    @Override
    public Great selectByPrimaryKey(Long id) {
        return greatMapper.selectByPrimaryKey(id);
    }


    @Override
    public List<Great> selectAll() {
        return greatMapper.selectAll();
    }

    @Override
    public void updateByPrimaryKey(Great record) {
        greatMapper.updateByPrimaryKey(record);
    }

    @Override
    public Integer getCountByTravelContentId(Long travelContentId) {
        return greatMapper.getCountByTravelContentId(travelContentId);
    }

    @Override
    public Great selectByUserIdAndTravelContentId(Long travelContentId, Long userId) {
        return greatMapper.selectByUserIdAndTravelContentId(travelContentId,userId);
    }

    @Override
    public void deleteRelation(Long travelContentId, Long userId) {
        greatMapper.deleteRelation(travelContentId,userId);
    }

    @Override
    public List<Map> getGoodsContent(Long userId) {
        return greatMapper.getGoodsContent(userId);
    }

    @Override
    public void insertDeleteRelation(Long travelContentId, Long userId) {
        greatMapper.insertDeleteRelation(travelContentId,userId);
    }

    @Override
    public List<Map> getDeleteGoods(Long userId) {
        return greatMapper.getDeleteGoods(userId);
    }

    @Override
    public int getDeleteCount(Long userId) {
        return greatMapper.getDeleteCount(userId);
    }

    @Override
    public int getGoodCount(Long userId) {
        return greatMapper.getGoodCount(userId);
    }

    @Override
    public void updateDeleteStateById(Long userId) {
        greatMapper.updateDeleteStateById(userId);
    }

    @Override
    public void updateGoodsStateById(Long userId) {
        greatMapper.updateGoodsStateById(userId);
    }

}
